//
//  LCHistoryDataManager.m
//  JKFuYinProject
//
//  Created by jiukuyinyue on 2017/10/14.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LCHistoryDataManager.h"
#import "LSZOfflineVideoManager.h"

@implementation LCHistoryDataManager

IMPLEMENTATION_SINGLETON(LCHistoryDataManager)

+ (NSString *)loadBibleTextTitleData{
    NSString *strTitle = [self loadBibleTextData][@"title"];
    if (strTitle == nil) {
        strTitle = @"旧约创世记(创)第1章";
    }
    return strTitle;
}

+ (NSDictionary *)loadBibleTextData{
    NSDictionary *bibleTextJson = [[NSUserDefaults standardUserDefaults] objectForKey:@"BIBLETEXT"];
    if (bibleTextJson == nil) {
        bibleTextJson = @{
                          @"duration" : @(341000),
                          @"fileUrl" : @"http://mp3hot.9ku.com/hot/2013/07-11/543970.mp3",
                          @"id" : @(1),
                          @"singerName" : @"圣经旧约",
                          @"title" : @"旧约创世记(创)第1章"
                          };
    }
    return bibleTextJson;
}
+ (NSString *)loadOneSongsData{
    
    if (![[NSUserDefaults standardUserDefaults] objectForKey:@"TENSONGS"]) {
        return @"暂无纪录";
    }
    NSString *strTitle = [[self loadTenSongsData] lastObject][@"title"];
    return strTitle;
}

+ (NSString *)loadOneVideosData{
    if ([self loadTenVideosData].count == 0) {
        return @"暂无纪录";
    }
    NSString *strTitle = [self loadTenVideosData].lastObject[@"title"];
    NSLog(@"%@",strTitle);
    return strTitle;
}
+ (NSArray *)loadTenSongsData{
    NSArray *selectedData = [[NSUserDefaults standardUserDefaults] objectForKey:@"TENSONGS"];
    return selectedData;
}

+ (NSArray *)loadTenVideosData{
    NSArray *arrayGetData = [[NSArray alloc] initWithContentsOfFile:[LSZSpecialPackaging recordTheBrowsingHistoryVideo]];
    return arrayGetData;
}

+ (NSArray *)loadDownloadSongsData{
    NSArray *selectedData = [[NSUserDefaults standardUserDefaults] objectForKey:@"DOWNLOADONGS"];
    return selectedData;
}

@end
